<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>黔南民族师范学院综合教育学分认定系统</title>

    <link rel="stylesheet" href="/jquery-easyui-1.3.5/themes/icon.css" />
    <link rel="stylesheet" href="/jquery-easyui-1.3.5/themes/default/easyui.css"/>

    <script type="text/javascript" src="/jquery-easyui-1.3.5/jquery.min.js"></script>
    <script type="text/javascript" src="/jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/jquery-easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">

        function clearAll(){
            document.getElementById("username").value="";
            document.getElementById("password").value="";
        }

        $(function(){
            $("input[name=username]").validatebox({
                required:true,
                missingMessage:'请输入用户名'
            });
            $("input[name=password]").validatebox({
                required:true,
                missingMessage:'请输入密码'
            });

            $("#loginForm").form("disableValidation");

            $("#btnLogin").click(function(){
                $("#loginForm").form("enableValidation");
                if($("#loginForm").form("validate")){
                    $("#loginForm").submit();
                }
            });
            $(document).ready(function(){

                var msg = $("#msg").attr("value");
                if (msg!=null){
                    $.messager.show({
                        title:'温馨提示',
                        msg:msg+"登录失败请检查用户名或密码是否正确",
                        timeout:5000,
                        showType:'slide'
                    });
                }
            });


        });
    </script>
</head>
<body style="height:100%;width:100%;overflow:hidden;border:none;visibility:visible;">
<div id="mainwindow" class="easyui-window" style="width:520px;height:300px;background:#fafafa;overflow:hidden"
     title="登录" border="0" resizable="false" draggable="false">
    <div class="header" style="height:35px;">
        <div class="toptitle" style="margin-top:25px; font-size:20px; text-align:center; color:#ea0000">
            黔南民族师范学院综合教育学分认定系统
        </div>
        <div>
            <!--判断是否显示，使用if, ${}可以使用工具类，可以看thymeleaf的中文文档-->
            <p style="color: red" th:value="${msg}" th:if="${not #strings.isEmpty(msg)}" >
            </p>

        </div>
        <!--登录错误提示信息-->
        <div class="error_tip" th:if="${param.error}">
            <span th:value="${session?.SPRING_SECURITY_LAST_EXCEPTION?.message}" class="help-block" style="color:red;" id="msg"></span>
        </div>
    </div>
    <div style="padding:50px 0;">
        <form id="loginForm" method="post" action="/login">
            <div style="padding-left:150px">
                <table cellpadding="0" cellspacing="3">
                    <tr>
                        <td align="right" style="font-size:14px;">用户名：</td>
                        <td><input id="username" name="username" type="text" style="width:114px;"></input></td>
                    </tr>
                    <tr></tr>
                    <tr></tr>
                    <tr>
                        <td align="right" style="font-size:14px;">密&nbsp;&nbsp;&nbsp;码：</td>
                        <td><input id="password" name="password" type="password" style="width:114px;"></input></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center">
                            <a id="btnLogin" class="easyui-linkbutton">登 录</a>
                            <a id="rstBtn" class="easyui-linkbutton" onclick="clearAll()">重 置</a>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
</div>
</body>
</html>